package com.haoshuang.zhouzhoubang.ui.page.order.time


import android.graphics.Color
import android.util.Log
import com.haoshuang.zhouzhoubang.R
import com.haoshuang.zhouzhoubang.databinding.ItemTimec22Binding

import com.haoshuang.zhouzhoubang.model.bean.TimeBean2
import com.mufeng.libs.base.BaseBindingHolder
import com.mufeng.libs.base.BaseBindingQuickAdapter
import com.mufeng.libs.utils.view.gone
import com.mufeng.libs.utils.view.visible
import java.util.*


/**
 * 订单模块中的订单列表适配器
 * */
class TimeCheckAdapter22(data: MutableList<TimeBean2>) :
    BaseBindingQuickAdapter<TimeBean2, ItemTimec22Binding>(data){

    override fun onBindViewHolder(holder: BaseBindingHolder, position: Int, item: TimeBean2?) {
        val binding = ItemTimec22Binding.bind(holder.itemView)
        binding.apply {
            tvTime.text=item?.service_time

            if (item?.isCheck==0){
                llGb.setBackgroundResource(R.drawable.bg18h)
                tvTime.setTextColor(Color.parseColor("#666666"))
            }else if (item?.isCheck==2){
                llGb.setBackgroundResource(R.drawable.bg18h2)
                tvTime.setTextColor(Color.parseColor("#666666"))
            }else{
                llGb.setBackgroundResource(R.drawable.bg18l)
                tvTime.setTextColor(Color.parseColor("#ffffff"))
            }
            if (item?.is_full==0){
                tvTs.gone()
            }else{
                tvTs.visible()
            }

        }
    }

}